package edu.hawaii.duedates.configuration;

import static org.junit.Assert.assertEquals;
import java.io.File;
import org.junit.Test;
/**
 * A simple test of the ConfigurationManager to see that it can read in the example data. 
 * @author Tyler Wolff
 */
public class TestConfigurationManager {

  /**
   * Read in duedates.example.xml and see that it was processed correctly. 
   * @throws Exception If problems occur. 
   */
  @Test
  public void testConfigurationManager() throws Exception {
    File exampleDueDatesXml = new File(System.getProperty("user.dir") + 
        "/xml/duedates.example.xml");
    File exampleDueDatesXsd = new File(System.getProperty("user.dir") + 
    "/xml/duedates.definition.xsd");
    ConfigurationManager manager = new ConfigurationManager(exampleDueDatesXml, exampleDueDatesXsd);
    DueDatesConfiguration config = manager.getDueDates();
    assertEquals("Testing smpt server name", "mail.hawaii.edu", config.getSmtpServer());
  }
}
